
import 'dart:async';

import 'package:flutter/services.dart';

enum KwPayMode{
  dev,pro
}

enum KwPayPlatform{
  upPay
}

class KwPay {
  static const MethodChannel _channel =
      const MethodChannel('kw_pay');

  static Future<dynamic> startPay(String orderId,KwPayMode mode,KwPayPlatform payPlatform){
    String m = "dev";
    String plat = "upPay";
    switch(mode){
      case KwPayMode.dev:
        m = "dev";
        break;
      case KwPayMode.pro:
        m = "pro";
        break;
    }
    switch(payPlatform){
      case KwPayPlatform.upPay:
        plat = "upPay";
        break;
    }
    return _channel.invokeMethod("pay",{
      "type":plat,
      "orderId":orderId,
      "mode":m
    });
  }
}
